package wechat.bean.response.message.receive;

import org.dom4j.DocumentException;

import wechat.bean.response.MessageBaseBean;

/**
 * 语音消息
 * 
 *
 */
public class ReceiveVoiceBean extends MessageBaseBean {
	private String Format;  //一般为amr格式
	private String Recognition;
	private String MediaId;
	
	public ReceiveVoiceBean(String str) throws DocumentException {
		super(str);
		super.setMsgType(Receive_Message_Voice);
	}
	
	public ReceiveVoiceBean(){
		super.setMsgType(Receive_Message_Voice);
	}

	
	public String getFormat() {
		return Format;
	}

	public void setFormat(String format) {
		Format = format;
	}
	public String getRecognition() {
		return Recognition;
	}

	public void setRecognition(String recognition) {
		Recognition = recognition;
	}
	public String getMediaId() {
		return MediaId;
	}

	public void setMediaId(String mediaId) {
		MediaId = mediaId;
	}

	
	protected static final String Xpath_Format = "/xml/Format";
	protected static final String Xpath_MediaId = "/xml/MediaId";
	protected static final String Xpath_Recognition = "/xml/Recognition";
	
	public void transform() throws Exception {
		super.transform();
		this.setFormat(getNodeText(Xpath_Format));
		this.setMediaId(getNodeText(Xpath_MediaId));
		this.setRecognition(getNodeText(Xpath_Recognition));
	}
	
	
//	public String buildXml() throws Exception {
//		super.buildXml();
//		super.addNode("Format", getFormat());
//		super.addNode("MediaId", getMediaId());
//		return parent.asXML();
//	}




}
